package com.hd.trans.network.component;

import com.hd.trans.network.bean.UserInfoBean;

public class AiSparingConfig {
    private AiSparringManager.AiAnchor aiAnchor;
    private UserInfoBean userInfoBean;
    private String aiSetting;
    private String ttsCode;
    private String lang;
    private float pitch;
    private String aliKey;//阿里云语音识别key
    private boolean isAiSparing;//是否开启ai陪练
    private boolean isEraseGreen;//是否擦除绿幕,默认不擦除。ffmpeg擦除绿幕比较耗时，也可以获得原视频，自己处理。
    private AiSparringManager.MediaType mediaType;
    private int screenWidth;
    private int screenHeight;
    private String voice;//引擎2独有，参考的语音文件路径（可读的网络语音文件）
    private String type;//引擎2独有，语气类型
    private int engine;//默认引擎1，引擎2是优质语音
    private String aiModel;//ai模型


    private AiSparingConfig(AiSparringManager.AiAnchor aiAnchor,
                           UserInfoBean userInfoBean,
                           String aiSetting,
                           String ttsCode,
                           String lang,
                            float pitch,
                           String aliKey,
                           boolean isAiSparing,
                           boolean isEraseGreen,
                           AiSparringManager.MediaType mediaType,
                           int screenWidth,
                           int screenHeight,
                            String voice,
                            String type,
                            int engine,
                            String aiModel) {
        this.aiAnchor = aiAnchor;
        this.userInfoBean = userInfoBean;
        this.aiSetting = aiSetting;
        this.pitch = pitch;
        this.ttsCode = ttsCode;
        this.lang = lang;
        this.aliKey = aliKey;
        this.isAiSparing = isAiSparing;
        this.isEraseGreen = isEraseGreen;
        this.mediaType = mediaType;
        this.screenWidth = screenWidth;
        this.screenHeight = screenHeight;
        this.voice = voice;
        this.type = type;
        this.engine = engine;
        this.aiModel = aiModel;
    }

    public AiSparringManager.AiAnchor getAiAnchor() {
        return aiAnchor;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public String getAiSetting() {
        return aiSetting;
    }

    public void setTtsCode(String ttsCode) {
        this.ttsCode = ttsCode;
    }
    public void setLang(String lang) {
        this.lang = lang;
    }

    public String getTtsCode() {
        return ttsCode;
    }

    public void setPitch(float pitch) {
        this.pitch = pitch;
    }

    public float getPitch() {
        return pitch;
    }

    public String getAliKey() {
        return aliKey;
    }

    public int getScreenWidth() {
        return screenWidth;
    }

    public int getScreenHeight() {
        return screenHeight;
    }

    public void setAiSparing(boolean aiSparing) {
        isAiSparing = aiSparing;
    }

    public boolean isAiSparing() {
        return isAiSparing;
    }

    public boolean isEraseGreen() {
        return isEraseGreen;
    }

    public AiSparringManager.MediaType getMediaType() {
        return mediaType;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setEngine(int engine) {
        this.engine = engine;
    }

    public String getType() {
        return type;
    }

    public String getLang() {
        return lang;
    }

    public int getEngine() {
        return engine;
    }

    public String getVoice() {
        return voice;
    }

    public void setVoice(String voice) {
        this.voice = voice;
    }

    public String getAiModel() {
        return aiModel;
    }

    public void setAiModel(String aiModel) {
        this.aiModel = aiModel;
    }

    public static class Builder {
        private AiSparringManager.AiAnchor aiAnchor = AiSparringManager.AiAnchor.W3_720;
        private UserInfoBean userInfoBean;
        private String aiSetting;
        private String ttsCode = "Lili-enhanced";
        private String lang;
        private float pitch = 1f;
        private String aliKey = "l9VUnPUOuiSi0OPu";
        private boolean isAiSparing = true;
        private boolean isEraseGreen = false;
        private AiSparringManager.MediaType mediaType = AiSparringManager.MediaType.Audio;
        private int screenWidth = 480*2;
        private int screenHeight = 640*2;
        private String type;
        private String voice;
        private int engine = 1;
        private String aiModel = "deepseekv3";

        public AiSparingConfig build() {
            return new AiSparingConfig(aiAnchor, userInfoBean, aiSetting, ttsCode, lang, pitch, aliKey, isAiSparing, isEraseGreen, mediaType, screenWidth, screenHeight, voice, type, engine, aiModel);
        }

        public Builder setAiAnchor(AiSparringManager.AiAnchor aiAnchor) {
            this.aiAnchor = aiAnchor;
            return this;
        }

        public Builder setUserInfoBean(UserInfoBean userInfoBean) {
            this.userInfoBean = userInfoBean;
            return this;
        }

        public Builder setAiSetting(String aiSetting) {
            this.aiSetting = aiSetting;
            return this;
        }

        public Builder setTtsCode(String ttsCode) {
            this.ttsCode = ttsCode;
            return this;
        }

        public void setLang(String lang) {
            this.lang = lang;
        }

        public Builder setPitch(float pitch) {
            this.pitch = pitch;
            return this;
        }

        @Deprecated
        public Builder setAliKey(String aliKey) {
            this.aliKey = aliKey;
            return this;
        }

        public Builder setAiSparing(boolean aiSparing) {
            isAiSparing = aiSparing;
            return this;
        }

        public Builder setEraseGreen(boolean eraseGreen) {
            isEraseGreen = eraseGreen;
            return this;
        }

        public Builder setMediaType(AiSparringManager.MediaType mediaType) {
            this.mediaType = mediaType;
            return this;
        }

        public Builder setScreenWidth(int screenWidth) {
            this.screenWidth = screenWidth;
            return this;
        }

        public Builder setScreenHeight(int screenHeight) {
            this.screenHeight = screenHeight;
            return this;
        }

        public Builder setType(String type) {
            this.type = type;
            return this;
        }

        public Builder setVoice(String voice) {
            this.voice = voice;
            return this;
        }

        public Builder setEngine(int engine) {
            this.engine = engine;
            return this;
        }

        public Builder setAiModel(String aiModel) {
            this.aiModel = aiModel;
            return this;
        }
    }

}
